package com.usefullc.common.enums;


import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 应用类型
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DataDictTypeEnum {

    INTEGER(0, "整数"),
    LONG(1, "长整"),
    SHORt(2, "短整"),
    DOUBLE(3, "双精度"),
    FLOAT(4, "单精度"),
    STRING(5, "字符"),
    BOOLEAN(6, "布尔"),
    BYTE(7, "字节"),




    ;


    private int code;
    private String value;

    DataDictTypeEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }



    public static DataDictTypeEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (DataDictTypeEnum s : DataDictTypeEnum.values()) {
            if (s.getCode() == code) {
                return s;
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {


        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

}
